<script setup lang="ts">
import { ref } from 'vue';
const props = defineProps<{
    disabled?: boolean
}>()

const emit = defineEmits<{
    'on-show': []
    'on-delete': []
}>()
// 更多
const showPopover = ref(false)
const actions = [
    { text: '查看处方', disabled: props.disabled },
    { text: '删除订单' }
]

const onSelect = (action: { text: string }, index: number) => {
    // 查看订单
    if (index === 0) emit('on-show')
    // 删除订单
    if (index === 1) emit('on-delete')
}
</script>


<template>
    <div class="more">
        <van-popover v-model:show="showPopover" :actions="actions" @select="onSelect" placement="top-start">
            <template #reference>
                更多
            </template>
        </van-popover>
    </div>
</template>

<style scoped lang="scss">
.more {
    color: var(--cp-tag);
    flex: 1;
    font-size: 13px;
}
</style>
